package cn.edu.scau.cmi.zhangjunming.singleton;

import java.util.ArrayList;

public class Marshal {
	private static ArrayList<Marshal> instance = new ArrayList<Marshal>();
	
	private static String name;
	//private int length = 0;
	
	private Marshal(String name) {
		this.name = name;
	}
	//创建
	public static Marshal getInstance(String name) {
		if(instance.size()<10) {
			instance.add(new Marshal(name));
			return instance.get(instance.size()-1);
		}
		return null;
	}
	
	//获取名字
	public static String getName() {
		return name;
	}
	
	//获取列表
	public static ArrayList<Marshal> getList(){
		return instance;
	}

}
